package burp.Utils;

import burp.BurpExtender;

public class LoggerUtils {

    private static final String PLUGIN_NAME = "[ParamNullifier] ";
    private static final String LEVEL_INFO = "[INFO] ";
    private static final String LEVEL_WARN = "[WARN] ";
    private static final String LEVEL_ERROR = "[ERROR] ";

    private LoggerUtils() {}

    public static void info(String message) {
        BurpExtender.getInstance().getCallbacks().printOutput(PLUGIN_NAME + LEVEL_INFO + message);
    }

    public static void warn(String message) {
        BurpExtender.getInstance().getCallbacks().printError(PLUGIN_NAME + LEVEL_WARN + message);
    }

    public static void error(String message, Throwable e) {
        BurpExtender.getInstance().getCallbacks().printError(PLUGIN_NAME + LEVEL_ERROR + message + ": " + e.getMessage());
    }

    public static void error(String message) {
        error(message, new Exception());
    }
}
